@extends('backstage.layout.master')
@section('title', '添加赠品')
@section('style')
    <!-- page specific plugin styles -->

    <link rel="stylesheet" href="assets/css/jquery-ui-1.10.3.custom.min.css"/>
    <link rel="stylesheet" href="assets/css/chosen.css"/>
    <link rel="stylesheet" href="assets/css/datepicker.css"/>
    <link rel="stylesheet" href="assets/css/bootstrap-timepicker.css"/>
    <link rel="stylesheet" href="assets/css/daterangepicker.css"/>
    <link rel="stylesheet" href="assets/css/colorpicker.css"/>

    <!-- fonts -->

@stop
@section('content')
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
            <li>
                <i class="icon-home home-icon"></i>
                <a href="backstage/home">主页</a>
            </li>

            <li class="active">
                <a href="/backstage/gift/gift-list">优惠</a>
            </li>
            <li>
                添加赠品
            </li>
        </ul><!-- .breadcrumb -->
    </div>

    <div class="page-content">
        <div class="row">
            <div class="col-xs-12">
                <!-- PAGE CONTENT BEGINS -->
                <div class="page-header">
                    <h1>
                        优惠
                        <small>
                            <i class="icon-double-angle-right"></i>
                            添加赠品
                        </small>
                    </h1>
                </div>
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->

                        <form class="form-horizontal" role="form" action="" method="post" enctype="multipart/form-data">
                            <div class="form-group {{$errors->first('gift_name')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 赠品名称 </label>

                                <div class="col-sm-4">
                                    <input type="text" name="gift_name" value="{{ old('gift_name') }}" id="form-field-1" placeholder="赠品名称"
                                           class="width-100">
                                </div>
                                <div class="col-sm-5">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('gift_name')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('gift_image')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
                                    赠品图片</label>

                                <div class="col-sm-4">
                                    <input type="file"  name="image" placeholder="赠品图片">
                                </div>
                                <div class="col-sm-5">
                                    <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('gift_image')}}</div>
                                </div>
                            </div>
                            <div class="form-group {{$errors->first('date-range-picker')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1">
                                    上架时间 </label>
                                <div class="col-sm-4">
                                    <input type="text" class="form-control"  name="date-range-picker" id="form-field-8"
                                           placeholder="点击选择"/>
                                </div>
                                <div class="col-sm-4">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('date-range-picker')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('param_desc')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 参数简介</label>

                                <div class="col-sm-4">
                                    <textarea class="form-control" name="param_desc" id="form-field-8"
                                              placeholder="参数简介">{{ old('param_desc') }}</textarea>
                                </div>
                                <div class="col-sm-5">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('param_desc')}}</div>
                                </div>
                            </div>
                            <div class="space-4"></div>
                            <div class="form-group {{$errors->first('gift_desc')!=""?'has-error':''}}">
                                <label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 赠品简介</label>

                                <div class="col-sm-4">
                                    <textarea class="form-control" name="gift_desc" id="form-field-8"
                                              placeholder="赠品简介">{{ old('gift_desc') }}</textarea>
                                </div>
                                <div class="col-sm-5">
                                    <div class="help-block col-xs-12 col-sm-reset inline"> {{$errors->first('gift_desc')}}</div>
                                </div>
                            </div>
                            <div class="clearfix form-actions">
                                <div class="col-md-offset-3 col-md-9">
                                    <button class="btn btn-info" type="submit">
                                        <i class="icon-ok bigger-110"></i>
                                        保存
                                    </button>
                                </div>
                            </div>
                        </form>


                    </div><!-- /.col -->
                </div>
                <!-- PAGE CONTENT ENDS -->
            </div><!-- /.col -->
        </div><!-- /.row -->
    </div><!-- /.page-content -->
@stop
@section('script')
    <script src="backstage/assets/js/date-time/bootstrap-datepicker.min.js"></script>
    <script src="backstage/assets/js/date-time/bootstrap-timepicker.min.js"></script>
    <script src="backstage/assets/js/date-time/moment.min.js"></script>
    <script src="backstage/assets/js/date-time/daterangepicker.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $('#gift_image').ace_file_input({
                no_file: '还未选择图片',
                btn_choose: '选择',
                btn_change: '重新选择',
                droppable: false,
                onchange: null,
                thumbnail: true //| true | large
            });
            $('input[name=date-range-picker]').daterangepicker().prev().on(ace.click_event, function () {
                $(this).next().focus();
            });
        });
    </script>
@stop
